Channel switching time is a critical factor affecting user experience. Therefore, fast channel switching becomes a focus concerned in the industry. The so-called fast channel switching refers to a shorter channel switching time than common channel switching time. The common channel switching time is generally required to be not longer than 2 seconds, whereas the fast channel switching time is generally required to be not longer than 1 second, and even not longer than 500 milliseconds.
There are many factors that affect the channel switching time, where a waiting delay of key information and an I frame is one critical factor that affects the channel switching time. The key information refers to configuration information required for initialization of a demultiplexer or a decoder. The key information may include, but is not limited to information such as a PAT (Program Association Table, program association table), a PMT (Program Map Table, program map table), a CAT (Conditional Access Table, conditional access table), a PCR (Program Clock Reference, program clock reference), an SPS (Sequence Parameter Set, sequence parameter set), a PPS (Picture Parameter Set, picture parameter set), and SEI (Supplemental Enhanced Information, supplemental enhanced information). If a medium is transmitted based on a TS (Transport Stream, transport stream), before demultiplexing, information such as the PAT, PMT, CAT and PCR is needed; if a medium is transmitted by using H.264 encoding, before decoding, information such as the SPS, PPS and SEI needs to be obtained. The I frame refers to an intra-frame prediction frame. The decoder starts decoding after receiving the I frame.
In the industry, a well-recognized method for implementing fast channel switching based on reducing the waiting delay of the key information and I frame is:
(1) A cache server is set in a network, and the cache server joins a multicast group, and receives and caches multicast data; (2) during channel switching, a terminal sends a fast channel switching request to the cache server, and the cache server selects an I frame closest to current time after receiving the request, and extracts key information; (3) the cache server sends the key information to the terminal through unicast, and then, starting from the I frame, sends the cached multicast data to the terminal through unicast; (4) at proper time, the terminal joins the multicast group and receives the multicast data. When the data received by the terminal through unicast and through multicast, respectively, is the same, the terminal instructs the cache server to stop sending the data.
The foregoing cache server is usually used as a retransmission server at the same time. During play of a channel, the terminal receives and plays the multicast data. The transport protocol used by multicast is UDP (User Datagram Protocol, user datagram protocol); and therefore the data may be lost. When detecting data loss, the terminal sends a retransmission request to the cache server. The cache server retransmits lost data to the terminal through unicast, performs status maintenance of the server, records the terminal sending the fast channel switching request, and maintains an individual channel switching data source for each terminal sending the fast channel switching request. After receiving the retransmission request from the terminal, the cache server determines whether the terminal is a fast channel switching terminal, and determines data to be retransmitted to the terminal. This needs the cache server to perform the status maintenance, which is sure to consume a lot of resources and cause a problem of poor scalability.